package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbItemCatMapper;
import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbItem;
import com.dongdongshop.pojo.TbItemCat;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TbItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbItemCatServiceImpl implements TbItemCatService {

    @Autowired
    private TbItemCatMapper tbItemCatMapper;
    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;

    @Override
    public List<TbItemCat> selectById(Long id) {
        List<TbItemCat> tbItemCats = tbItemCatMapper.selectById(id);
        return tbItemCats;
    }

    @Override
    public Boolean insert(TbItemCat tbItemCat) {
        int i = tbItemCatMapper.insertSelective(tbItemCat);
        return i>0;
    }

    @Override
    public TbItemCat updata(Long id) {
        TbItemCat tbItemCat = tbItemCatMapper.selectByPrimaryKey(id);
        return tbItemCat;
    }

    @Override
    public Boolean updates(TbItemCat tbItemCat) {
        int i = tbItemCatMapper.updateByPrimaryKeySelective(tbItemCat);
        return i>0;
    }

    @Override
    public Boolean deleteByid(Long[] ids) {
        tbItemCatMapper.delteByids(ids);
        return true;
    }

    @Override
    public TbItemCat select(Long id) {
        TbItemCat tbItemCat = tbItemCatMapper.selectByPrimaryKey(id);
        return tbItemCat;
    }

    @Override
    public TbTypeTemplate gettemplateById(Long id) {
        TbTypeTemplate tbTypeTemplate = tbTypeTemplateMapper.selectByPrimaryKey(id);
        return tbTypeTemplate;
    }

    @Override
    public TbTypeTemplate selectByIds(Long id) {
        TbTypeTemplate tbTypeTemplate = tbTypeTemplateMapper.selectByPrimaryKey(id);
        return tbTypeTemplate;
    }



}
